﻿@{
    ViewBag.Title = "详情";
    var id = Model != null ? Model.ID : 0;
}
@using ZBJF.Warranty.BLL
@using ZBJF.Warranty.WebProvider
@model ZBJF.Warranty.Model.InsuranceProductPackage
@section Header{
    @Styles.Render("~/Content/chosen")
}
<div class="table-responsive dataTables_wrapper">
    @Html.Hidden("hdntr")
    <table id="sellersList" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th width="20">序号</th>
                <th width="80">保险类型</th>
                <th width="80">保险产品名称</th>
                <th width="100">是否启用</th>
                <th width="100">创建时间</th>
                <th width="100">最后修改时间</th>
            </tr>
        </thead>
        <tbody id="sellersTr">
            @{
                var list = Model != null ? Model.InsuranceProductPackageMapping : null;
                if (list != null)
                {
                    for (int i = 0; i < list.Count(); i++)
                    {

                        var baseProduct = list.ToList()[i].InsuranceProducts;
                        <tr>
                            <td>@(i + 1)</td>
                            <td>@(ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(ZBJF.Warranty.Common.Enums.Data.InsuranceProductCategory),baseProduct.InsuranceProductCategory))</td>
                            <td><a onclick='Open(@baseProduct.ID)'>@baseProduct.ProductName</a></td>
                            <td>@(baseProduct.IsAvailable?"是":"否")</td>
                            <td>@baseProduct.CreateTime</td>
                            <td>@baseProduct.LastModifyTime</td>
                        </tr>
                    }
                }
            }
        </tbody>
    </table>
</div>
@section scripts{
    <script type="text/javascript">
        function Open(insuranceProductId) {
            layer.open({
                type: 2,
                title: '商家保险产品详情',
                shade: 0.8,
                area: ['90%', '550px'],
                content: '/InsuranceProducts/Edit?id=' + insuranceProductId+ "&type=1" //iframe的url
            });
        }
    </script>
}